Image processing apparatus and image processing method

ABSTRACT

In an image processing apparatus and an image processing method for encoding image data in parallel with each other with a plurality of encoding units, the output rates of the encoding units can be dynamically controlled. The image data is converted to a plurality of pixel planes, and the plurality of encoding units  103   c  encode the pixel planes. An output rate control unit  103   d  controls the output rates to a shared memory from the plurality of encoding units  103   c  by controlling an access request that is to be output to a memory I/F unit  105,  in accordance with at least one of a pixel plane conversion mode and available capacities of buffers  103   b.

BACKGROUND OF THE INVENTION

Field of the Invention

The present invention relates to an image processing apparatus and animage processing method, and in particular to a technique for encodingan image.

Description of the Related Art

A single plane image sensor provided with a color filter is used in ageneral digital camera. Also, the primary color Bayer pattern shown inFIG. 2 is known as one color distribution pattern of a color filterprovided in the single plane image sensor. R (red), G1 (green), G2(green), and B (blue) are periodically arranged, 2×2 pixels being oneunit, in the primary color Bayer pattern. Because human vision is moresensitive to the luminance component than the color components, greenpixels containing a larger luminance component than a red or blue pixelare arranged in a greater number than the red and blue pixels.

A signal that has been read out from the single plane image sensor hasone color component per pixel. Such a signal format is called the RAWformat, and RAW format data is called RAW data. Also, a signal obtainedby classifying the signals of all of the pixels in terms of thecorresponding color filter is called a pixel plane. If a color filterwith the primary color Bayer pattern is used, the pixel signals areclassified into an R plane, a G1 plane, a G2 plane, and a B plane. Thepixel plane is also called a color plane, or a component.

Because RAW data has a large data amount, if the RAW data is recorded ortransmitted, it has been known that the RAW data is encoded in order toreduce the data amount. In this case, in order to shorten the processingtime, as with an encoder 800 shown in FIG. 8, for example, aconfiguration is possible in which a component converter 801 thatseparates the RAW data into pixel planes is provided, and four encodingunits 802 encode respective pixel planes. For example, in the case ofRAW data with the primary color Bayer pattern, the component converter801 separates the RAW data into an R plane (C1), a G1 plane (C2), a G2plane (C3), and a B plane (C4). The encoding units 802 respectivelyencode one pixel plane and output encoded data.

If the outputs of the four encoders 802 are connected to a shared databus, in order to utilize the capability of the individual encoding units802 to a maximum, it is important to allocate an appropriate output rateto the individual encoding unit 802 in accordance with the amount ofencoded data that is to be generated. Japanese Patent Laid-Open No.2003-132007 discloses a method for, in a digital camera in which aplurality of processing modules share a data bus, setting and managingtiming and length of a time period during which the data bus can be usedby each processing module.

The amount of encoded data generated in the individual encoding unit 802may change depending on the type of signal that the encoding unit 802encodes, the operation mode of the encoding unit, and the like, and thusit is important to dynamically control the rate of outputting theencoded data. However, in the method disclosed in Japanese PatentLaid-Open No. 2003-132007, the timing and the length of a time periodduring which the data bus can be used are fixed for each module, andthus the output rate of the module cannot be dynamically controlled.Therefore, the encode amount may be too high or too low in the allocatedtime period, and the encoding efficiency decreases.

SUMMARY OF THE INVENTION

The present invention has been made in light of such issues in therelated art. The present invention provides an image processingapparatus and an image processing method that can dynamically controlthe output rates of a plurality of encoding units when the encodingunits encode pieces of image data in parallel with each other.

According to one aspect of the present invention, there is provided animage processing apparatus comprising: a conversion unit configured toconvert image data to a plurality of pixel planes; a plurality of firststorage units configured to respectively store one of the plurality ofpixel planes; a plurality of encoding units configured to respectivelyencode a pixel plane stored in a corresponding one of the plurality offirst storage units; a rate control unit configured to control outputrates from the plurality of encoding units to a second storage unit; andan access control unit configured to grant an access request for accessto the second storage unit, wherein the rate control unit controls theoutput rates by controlling an access request that is to be output tothe access control unit among access requests to the second storage unitfrom the plurality of encoding units, in accordance with a conversionmode of the conversion unit and/or available capacities of the firststorage units.

According to another aspect of the present invention, there is providedan image capture apparatus comprising: an image sensor; a conversionunit configured to convert image data obtained by the image sensor to aplurality of pixel planes; a plurality of first storage units configuredto respectively store one of the plurality of pixel planes; a pluralityof encoding units configured to respectively encode a pixel plane storedin a corresponding one of the plurality of first storage units; a ratecontrol unit configured to control output rates from the plurality ofencoding units to a second storage unit; and an access control unitconfigured to grant an access request for access to the second storageunit, wherein the rate control unit controls the output rates bycontrolling an access request that is to be output to the access controlunit among access requests to the second storage unit from the pluralityof encoding units, in accordance with a conversion mode of theconversion unit and/or available capacities of the first storage units.

According to still another aspect of the present invention, there isprovided an image processing method executed by an image processingapparatus that comprises: a conversion unit configured to convert imagedata to a plurality of pixel planes; a plurality of first storage unitsconfigured to respectively store one of the plurality of pixel planes; aplurality of encoding units configured to respectively encode a pixelplane stored in a corresponding one of the plurality of first storageunits; a second storage unit shared by the plurality of encoding units;and an access control unit configured to grant an access request foraccess to the second storage unit, the method comprising: controllingthe output rates from the plurality of encoding units to the secondstorage unit, by controlling an access request that is to be output tothe access control unit among access requests to the second storage unitfrom the plurality of encoding units, in accordance with a conversionmode of the conversion unit and/or available capacities of the firststorage units.

According to yet another aspect of the present invention, there isprovided a non-transitory computer-readable storage medium storing aprogram for causing a computer to function as an image processingapparatus comprising: a conversion unit configured to convert image datato a plurality of pixel planes; a plurality of first storage unitsconfigured to respectively store one of the plurality of pixel planes; aplurality of encoding units configured to respectively encode a pixelplane stored in a corresponding one of the plurality of first storageunits; a rate control unit configured to control output rates from theplurality of encoding units to a second storage unit; and an accesscontrol unit configured to grant an access request for access to thesecond storage unit, wherein the rate control unit controls the outputrates by controlling an access request that is to be output to theaccess control unit among access requests to the second storage unitfrom the plurality of encoding units, in accordance with a conversionmode of the conversion unit and/or available capacities of the firststorage units.

Further features of the present invention will become apparent from thefollowing description of exemplary embodiments with reference to theattached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIGS. 1A and 1B are block diagrams showing a functional configurationexample of an image capture apparatus as an exemplary image processingapparatus according to an embodiment.

FIG. 2 is a schematic diagram showing a configuration of RAW data in aprimary color Bayer pattern.

FIG. 3 is a flowchart for illustrating the control of an output rate ina first embodiment.

FIGS. 4A and 4B are timing charts showing examples of the control ofoutput rates in the first embodiment.

FIG. 5 is a flowchart for illustrating the control of an output rate ina second embodiment.

FIG. 6 is a timing chart showing an example of the control of the outputrate in the second embodiment.

FIG. 7 is a flowchart for illustrating the control of an output rate ina third embodiment.

FIG. 8 is a block diagram showing a configuration example of aconventional encoder.

DESCRIPTION OF THE EMBODIMENTS

Exemplary embodiments of the present invention will now be described indetail in accordance with the accompanying drawings. Note that althougha configuration in which the present invention is applied to an imagecapture apparatus that is an example of an image processing apparatuswill be described in an embodiment described below, the configurationrelated to image capture is not essential for the present invention. Forexample, a configuration is possible in which image data that has beenalready recorded as a data file in any format is acquired from a storageapparatus or an external apparatus. Also, RAW data is an example ofpieces of image data that are suitable for undergoing encodingprocessing in parallel with each other.

First Embodiment

FIG. 1A is a block diagram schematically showing a functionalconfiguration example of an image capture apparatus 100 according to afirst embodiment, the functional configuration example related toencoding of RAW data.

A control unit 101 includes a programmable processor such as a CPU, anon-volatile memory such as a ROM that stores a program executed by theCPU, and a volatile memory such as a RAM for loading a program when theprogram is executed, for example. Then, operations of blocks of theimage capture apparatus 100 are controlled and the function of the imagecapture apparatus 100 that includes encoding processing that will bedescribed later is realized by the CPU executing the program.

An image capture unit 102 includes an imaging optical system and animage sensor, photoelectrically converts an optical image of a subjectthat is formed by the imaging optical system on the imaging plane usinga plurality of pixels that are arranged in the image sensor, and outputsan image signal corresponding to the optical image. The control unit 101sets shooting conditions and performs exposure control in the imagecapture unit 102. The imaging optical system includes movable memberssuch as a focus lens, a variable magnification lens, and a diaphragm, amotor for driving them, and the like. The image sensor is a CCD or CMOSimage sensor, for example. Also, the image capture unit 102 has an A/Dconversion function and converts an image signal into a digital format.Note that the image sensor may have the A/D conversion function. Theimage signal that is read out from the image sensor and converted intothe digital format is RAW data including one color component per pixel.The image capture unit 102 writes the RAW data on a memory 104 through amemory I/F unit 105.

In the present embodiment, it is assumed that the image sensor has acolor filter having the primary color Bayer pattern that has repetitiveunits constituted by four subfilters of R (red), G1 (green), G2 (green),and B (blue), which are shown in FIG. 2. Note that the image sensor mayinclude a color filter having another color distribution or other colorcomponents.

A RAW data encoding unit 103 reads out the RAW data that is stored inthe memory 104 and has the primary color Bayer pattern, encodes the RAWdata in parallel for each pixel plane, and again writes the generatedencoded data to the memory 104. The configuration and operations of theRAW data encoding unit 103 will be described in detail later.

The memory 104 is a storage area for storing various types of data thatis output from units of the image capture apparatus 100, the memory 104being constituted by a volatile memory, for example, and is a storagearea (a shared resource) that is shared by a plurality of encoding unitsof the RAW data encoding unit 103.

The memory I/F unit 105 arbitrates access requests for the memory 104from the units (including the plurality of encoding units) of the imagecapture apparatus 100, and controls access (readout and writing) to thememory 104. In the present embodiment, upon receiving an access requestfor the memory 104 from the RAW data encoding unit 103 (an output ratecontrol unit 103 d), the memory I/F unit 105 outputs to the RAW dataencoding unit 103 a grant signal for granting the access to the memory104 for a fixed time period.

A recording processing unit 106 reads out the encoded data stored in thememory 104, and records the encoded data to a recording medium 107 thatis a semiconductor memory card, for example, in a predeterminedrecording format.

FIG. 1B is a block diagram schematically showing a functionalconfiguration example of the RAW data encoding unit 103.

A component conversion unit 103 a classifies pixel signals constitutingthe RAW data into subfilters (R, G1, G2, and B) that are included in therepetitive units of the color filter, and converts the image signals tofour pixel planes (C1 to C4). Four buffers 103 b each store a differentone of the four pixel planes. Four encoding units 103 c encode the pixelplanes stored in the corresponding buffers 103 b with a predeterminedmethod, and output encoded data. An output rate control unit 103 dcontrols the rates of outputting pieces of the encoded data that areoutput from the encoding units 103 c. Hereinafter, the operations of theunits will be described in more detail.

The component conversion unit 103 a has a conversion mode 1 in which R,G1, G2, and B signals obtained by classifying the RAW data are used asthe pixel planes without changing the format, and a conversion mode 2 inwhich the R, G1, G2, and B signals are converted to a signal formatexpressing a luminance component and another component (a colordifference component, for example), and used as the pixel planes. Theconversion mode can be dynamically changed by setting of the controlunit 101, for example. The setting of the conversion mode may be basedon an instruction given from a user, may be based on an operation modeof the apparatus, such as a shooting mode, or may be based on otherinformation. In the conversion mode 2, the G1 signal and G2 signal canbe converted to a low frequency component GL and a high frequencycomponent GH of a G signal by Haar conversion, for example, and thethree R, GL, and B signal components can be converted based on Equation1 below (a, b, c, d, and e are transformation coefficients that havebeen determined in advance).

D1=a×R+b×GL+c×B

D2=d×(B−D1)

D3=e×(R−D1)   Equation 1

Note that this is an example, and another method may be executed in theconversion mode 2.

Note that it is assumed that the component conversion unit 103 a of thepresent embodiment allocates the R, G1, G2, and B signals to the pixelplane C1 to C4 in each conversion mode as follows.

Conversion Mode 1

(C1, C2, C3, C4)=(R, G1, G2, B)

Conversion Mode 2

(C1, C2, C3, C4)=(D1, D2, D3, GH)

The component conversion unit 103 a writes the pixel planes to thecorresponding buffers 103 b. Also, the component conversion unit 103 acalculates the available capacity of each buffer 103 b from the writeaddress that it uses for the buffer 103 b and the read address that theencoding unit 103 c uses for the buffer 103 b, and outputs the availablecapacity to the output rate control unit 103 d.

The encoding units 103 c read out and encode the pixel planes stored inthe corresponding buffers 103 b, and generate encoded data. Also, theencoding units 103 c output access requests for writing the generatedencoded data to the memory 104 (hereinafter, referred to as transferrequests) to the output rate control unit 103 d, and output the encodeddata to the output rate control unit 103 d if the transfer request isgranted. Note that there is no particular limitation on the method bywhich the encoding units 103 c performing encoding, and known losslessor lossy encoding can be applied. An example may be a combination ofprocessing for conversion to frequency components using waveletconversion, discrete cosine conversion, or the like, processing forquantizing the conversion result (transformation coefficient),variable-length encoding such as Golomb encoding, Huffman encoding, orarithmetic encoding performed on the quantization result.

In the present embodiment, if the component conversion unit 103 a isoperating in the conversion mode 1, encode amount control is executed soas to uniformize the encode amounts that the encoding units 103 cgenerate for the pixel planes (R, G1, G2, and B). This can be realizedby setting the same target amount for the generated encode amounts inthe encoding units 103 c. For example, encode amount control can beperformed such that the ratio of generated encode amount targets for thepixel planes R, G1, G2, and B is 1:1:1:1.

If the component conversion unit 103 a is operating in the conversionmode 2, the encoding target pixel planes are the pixel plane D1 (C1)including a large amount of the luminance component, and the other pixelplanes D2, D3, and GH (C2-C4). Therefore, the encode amount control isexecuted on the pixel plane D1 that has a high visual importance andcontains a large amount of the luminance component, such that a largeroutput rate (large generated encode amount) than the other pixel planesare granted. This can be realized by making the target amount for thegenerated encode amount that is set in the encoding unit 103 ccorresponding to the pixel plane D1 larger than the target value for thegenerated encode amount that is set in the encoding units 103 ccorresponding to the other pixel planes D2, D3, and GH, for example. Forexample, encode amount control can be performed such that the ratio ofgenerated encode amount targets for the pixel planes D1, D2, D3, and GHis 3:1:1:1 or 3:1:1:2.

It is assumed that a relationship (or the allocated encoded data amount)between generated encode amount targets for pixel planes (or encodingunits corresponding to the pixel planes) corresponding to the conversionmode is defined in advance, and known to the output rate control unit103 d. Therefore, the output rate control unit 103 d can dynamicallycontrol the output rates for the plurality of encoding units 103 c byacquiring information indicating which conversion mode the componentconversion unit 103 a is operating in, from the component conversionunit 103 a.

The output rate control unit 103 d judges priorities for transferrequests respectively made by the encoding units 103 c, based onpriority information that is held by the output rate control unit 103 d,and outputs the transfer request that the output rate control unit 103 dhas judged to have the highest priority, to the memory I/F unit 105.Because the memory I/F unit 105 grants access to the memory 104 to thetransfer request source, the output rate control unit 103 d can controlthe rate of output to the memory 104 for each encoding unit 103 c by theoutput rate control unit 103 d selecting the transfer request output tothe memory I/F unit 105.

In the present embodiment, the rate for outputting the encoded data isdynamically controlled by updating the priority information held by theoutput rate control unit 103 d with different methods in accordance withthe conversion mode of the component conversion unit 103 a. Hereinafter,the output rate control method (priority information update method) ofthe present embodiment will be described based on the flowchart shown inFIG. 3. Note that the processing shown in FIG. 3 is executed repeatedlyat a predetermined frequency.

First, the output rate control unit 103 d judges the priority of thetransfer request that has been input from the encoding unit 103 c, basedon the priority information (step S300). Here, if there are no transferrequests whose priority needs to be judged, the output rate control unit103 d ends the processing (step S301, NO). On the other hand, if thereis a transfer request whose priority needs to be judged, the output ratecontrol unit 103 d outputs the transfer request that has been judged tohave the highest priority among the transfer requests, to the memory I/Funit 105 (step S301, YES), and advances the processing to step S302.

Next, the output rate control unit 103 d judges whether or not thecomponent conversion unit 103 a is operating in the conversion mode 2(step S302), and if it is judged that the component conversion unit 103a is operating in the conversion mode 2, the output rate control unit103 d advances the processing to step S303. Also, if it is not judgedthat the component conversion unit 103 a is operating in the conversionmode 2 (it is judged that the component conversion unit 103 a isoperating in the conversion mode 1), the output rate control unit 103 dadvances the processing to step S307, and updates the priorityinformation. In this case, the output rate control unit 103 d changesthe priority of the encoding unit 103 c, which is the transfer requestsource that has made the transfer request that was output to the memoryI/F unit 105 in step S301, to the lowest in step S307, and updates thepriority information by increasing the priorities of the remainingencoding units 103 c by one each. Note that the priorities may beassociated with the corresponding pixel planes instead of the encodingunits 103 c. When the priority information is updated, the output ratecontrol unit 103 d ends the processing.

On the other hand, if it is judged that the component conversion unit103 a is operating in the conversion mode 2, in step S303, the outputrate control unit 103 d judges whether or not the transfer request thathas been output to the memory I/F unit 105 is from the encoding unit 103c related to a predetermined pixel plane. If it is judged that thetransfer request that has been output to the memory I/F unit 105 is fromthe encoding unit 103 c related to the predetermined pixel plane, theoutput rate control unit 103 d advances the processing to step S304, andif this judgment is not made, advances the processing to step S307.

In the present embodiment, the output rate control unit 103 d judgeswhether or not the transfer request that has been output to the memoryI/F unit 105 is a transfer request that is associated with the pixelplane C1 and is from the encoding unit 103 c. In the conversion mode 2,the D1 signal containing a large amount of the luminance component isallocated to the pixel plane C1. Thus, the judgment in step S303 in thepresent embodiment may be a judgment about whether or not the transferrequest that has been output to the memory I/F unit 105 is the transferrequest related to the signal containing a large amount of the luminancecomponent.

If it is not judged that the transfer request that has been output tothe memory I/F unit 105 is from the encoding unit 103 c related to apredetermined pixel plane, similarly to the case of the conversion mode1, the output rate control unit 103 d updates the priority informationin step S307. That is, the output rate control unit 103 d changes thepriority of the encoding unit 103 c, which is the request source thatoutput the transfer request to the memory I/F unit 105 in step S301, tothe lowest, and updates the priority information by increasing thepriorities of the remaining encoding units 103 c by one each.

If it is judged that the transfer request that has been output to thememory I/F unit 105 is from the encoding unit 103 c related to thepredetermined pixel plane, in step S304, the output rate control unit103 d increments a counter rcnt. The counter rcnt may be a variable heldin a memory built into the output rate control unit 103 d, for example,and the initial value of the counter rcnt is 0. Note that the value ofthe counter rcnt indicates the number of times that the transfer requestfor the predetermined pixel plane has been output to the memory I/F unit105.

In step S305, the output rate control unit 103 d judges whether thevalue of the counter rcnt is a predetermined value N (N is an integer of1 or more) or more, and if it is judged that the value of the counterrcnt is N or more, the output rate control unit 103 d advances theprocessing to step S306, whereas if it is not judged that the counterrcnt is N or more (in the case of less than N), ends the processingwithout changing the priority information.

The output rate control unit 103 d initializes the value of the counterrcnt to 0 in step S306, and updates the priority information in stepS307. Here as well, the output rate control unit 103 d changes thepriority of the encoding unit 103 c, which is the request source thathas output the transfer request to the memory I/F unit 105 in step S301,to the lowest, and updates the priority information by increasing thepriorities of the remaining encoding units 103 c by one each.

That is, in the present embodiment, regardless of the conversion mode ofthe component conversion unit 103 a, the priority of the encoding unit103 c, which is the request source that outputs the transfer request tothe memory I/F unit 105, is changed to the lowest, and the priorityinformation is updated by increasing the priorities of the remainingencoding units 103 c by one each. However, if the component conversionunit 103 a is operating in the conversion mode 2 and the transferrequest output to the memory I/F unit 105 is a transfer requestregarding a particular pixel plane, the priority information is notchanged until the number of times the transfer request was outputsatisfies a condition. In other words, the priority for the transferrequest for a particular pixel plane is not lowered until the number oftimes the transfer request was output satisfies a condition.

When the priority information is updated in step S307, the output ratecontrol unit 103 d ends the processing. As described above, the outputrate control operation shown in FIG. 3 is repeatedly executed. Althoughthere is no limitation on the frequency or cycle of the repetition, theoutput rate control operation can be executed every time the transferprocessing granted by the memory I/F unit 105 is completed, or can beexecuted every fixed period.

A specific example of the output rate control described using FIG. 3will be described using timing charts shown in FIGS. 4A and 4B.Reference signs C1 to C4 indicate pixel planes, and reference signs p1to p4 indicate priorities in the priority information. The smaller thevalue is, the higher the priority is, and p1 has the highest priority.Reference signs T1 to T5 indicate times at which the output rate controlunit 103 d executes the processing of FIG. 3, outputs the transferrequest to the memory I/F unit 105, or updates the priority information.

FIG. 4A shows an example in which the component conversion unit 103 a isoperating in the conversion mode 1, and the pixel planes and thepriorities are associated with each other as follows in the priorityinformation in an initial state, for example.

(C1, C2, C3, C4)=(p1, p2, p3, p4)

Also, the encoding units 103 c have encoded data that is to betransferred at T1, and output transfer requests.

At T1, based on the priority information, the output rate control unit103 d outputs the transfer request for the pixel plane C1 among thetransfer requests from the encoding units 103 c to the memory I/F unit105. Also, the output rate control unit 103 d changes the priority ofthe pixel plane C1 for which the transfer request has been output, tothe lowest, and updates the priority information by increasing thepriorities of the other pixel planes by one each. The priorityinformation after the update is as follows.

(C1, C2, C3, C4)=(p4, p1, p2, p3)

If the memory I/F unit 105 grants transfer permission for the transferrequest output at T1, the encoded data of the pixel plane C1 is writtento the memory 104 from the corresponding encoding unit 103 c, via theoutput rate control unit 103 d and the memory I/F unit 105. This writingcan be performed by the encoding unit 103 c. When the transfer grantedtime period ends, the writing of the encoded data of the pixel plane C1ends, and the output of the transfer request from the encoding unit 103c corresponding to the pixel plane C1 and the output of the transferrequest from the output rate control unit 103 d also end.

At T2, the transfer request is again output from the encoding unit 103 ccorresponding to the pixel plane C1, and the output rate control unit103 d receives four transfer requests including the transfer requestsfrom the encoding units 103 c corresponding to the pixel planes C2 to C4that continue to have been received from T1. Based on the priorityinformation, the output rate control unit 103 d outputs the transferrequest for the pixel plane C2 to the memory I/F unit 105 at T2.Furthermore, the output rate control unit 103 d changes the priority ofthe pixel plane C2 for which the transfer request has been output, tothe lowest, and updates the priority information by increasing thepriorities of the other pixel planes by one each. The priorityinformation after the update is as follows.

(C1, C2, C3, C4)=(p3, p4, p1, p2)

When the memory I/F unit 105 grants transfer permission for the transferrequest output at T2, the encoded data of the pixel plane C2 is writtento the memory 104 from the corresponding encoding unit 103 c, via theoutput rate control unit 103 d and the memory I/F unit 105. When thetransfer granted time period ends, the writing of the encoded data ofthe pixel plane C2 ends, and the output of the transfer request from theencoding unit 103 c corresponding to the pixel plane C2 and the outputof the transfer request from the output rate control unit 103 d alsoend.

At T3, the transfer request is again output from the encoding unit 103 ccorresponding to the pixel plane C2, and the output rate control unit103 d receives four transfer requests including the transfer requestsfrom the encoding units 103 c corresponding to the other pixel planesC1, and C3 to C4 that continue to have been received. Based on thepriority information, the output rate control unit 103 d outputs thetransfer request for the pixel plane C3 to the memory I/F unit 105 atT3. Furthermore, the output rate control unit 103 d changes the priorityof the pixel plane C3 for which the transfer request has been output, tothe lowest, and updates the priority information by increasing thepriorities of the other pixel planes by one each. The priorityinformation after the update is as follows.

(C1, C2, C3, C4)=(p2, p3, p4, p1)

Hereinafter, similarly, at T4, the output rate control unit 103 doutputs the transfer request for the pixel plane C4 to the memory I/Funit 105, and updates the priority information as follows.

(C1, C2, C3, C4)=(p1, p2, p3, p4)

Furthermore, at T5, the output rate control unit 103 d outputs thetransfer requests for the pixel plane C1 to the memory I/F unit 105, andupdates the priority information as follows.

(C1, C2, C3, C4)=(p4, p1, p2, p3)

The output rate control unit 103 d repeats similar processingthereafter.

As described above, if the component conversion unit 103 a is operatingin the conversion mode 1, encode amount control is executed so as touniformize the encode amounts that the encoding units 103 c generate forthe pixel planes (R, G1, G2, and B). Therefore, the output rate controlunit 103 d updates the priority information (changes the priorities ofthe encoding units 103 c or the pixel planes) so as to give equalchances for transferring encoded data to the encoding units 103 c. Doingthis makes it possible to realize the control such that the time periodsduring which the encoding units 103 c are granted transfer areequalized, and the rates for outputting the encoded data to the pixelplanes are equal to each other.

FIG. 4B shows an example in which the component conversion unit 103 a isoperating in the conversion mode 2, and the pixel planes and thepriorities are associated with each other as follows in the priorityinformation in an initial state, for example.

(C1, C2, C3, C4)=(p1, p2, p3, p4)

Also, the encoding units 103 c output the transfer requests at T1 at thesame time. Furthermore, it is assumed that N=2 is set.

At T1, based on the priority information, the output rate control unit103 d outputs the pixel plane C1 transfer request among the transferrequests from the encoding units 103 c to the memory I/F unit 105. Also,since the output rate control unit 103 d outputs the transfer requestfor the pixel plane C1, the output rate control unit 103 d incrementsthe counter rcnt. Because the counter rcnt is 1 at this time, the outputrate control unit 103 d does not update the priority information.

If the memory I/F unit 105 grants transfer permission for the transferrequest output at T1, the encoded data of the pixel plane C1 is writtento the memory 104 from the corresponding encoding unit 103 c, via theoutput rate control unit 103 d and the memory I/F unit 105. When thetransfer granted time period ends, the writing of the encoded data ofthe pixel plane C1 ends, and the output of the transfer request from theencoding unit 103 c corresponding to the pixel plane C1 and the outputof the transfer request from the output rate control unit 103 d end.

At T2, the transfer request is again output from the encoding unit 103 ccorresponding to the pixel plane C1, and the output rate control unit103 d receives four transfer requests including the transfer requestsfrom the encoding units 103 c corresponding to the pixel planes C2 to C4that continue to have been received from T1. Because the priorityinformation has not been updated at T1, at T2 as well, based on thepriority information, the output rate control unit 103 d outputs thetransfer request for the pixel plane C1 to the memory I/F unit 105.Also, since the output rate control unit 103 d outputs the transferrequest for the pixel plane C1, the output rate control unit 103 dincrements the counter rcnt. Because the counter rcnt is 2 at this timeand the condition rcnt≧N is satisfied, the output rate control unit 103d updates the priority information.

The output rate control unit 103 d changes the priority of the pixelplane C2 for which the transfer request has been output to the lowest,and updates the priority information by increasing the priorities of theother pixel planes by one each. The priority information after theupdate is as follows.

(C1, C2, C3, C4)=(p4, p1, p2, p3)

The operations of the output rate control unit 103 d from T3 to T5 arethe same as the operations from T2 to T4 in the case where the componentconversion unit 103 a is operating in the conversion mode 1, which hasbeen described with reference to FIG. 4A, and therefore, the descriptionthereof is omitted.

As described above, if the component conversion unit 103 a is operatingin the conversion mode 2, encode amount control is executed such that agenerated encode amount larger than the other pixel planes are grantedfor the pixel plane C1 containing a large amount of the luminancecomponent having a high visual importance. Therefore, the output ratecontrol unit 103 d updates the priority information such that theencoding unit 103 c corresponding to the pixel plane C1 is grantedpermission to transfer encoded data for a longer time period than theencoding units 103 c corresponding to the other pixel planes (grantedpermission to transfer the encoded data with a higher frequency).

Specifically, the priority information is updated such that thefrequency with which the encoding unit 103 c corresponding to the pixelplane C1 (or the pixel plane C1) has the highest priority is higher thanthe frequency with which the encoding units corresponding to the otherpixel planes (or the other pixel planes) have the highest priority. Forexample, as described here, not updating the priority information cankeep a state in which the encoding unit 103 c (or the pixel plane C1)corresponding to the pixel plane C1 has the highest priority.Alternatively, the priority information may be updated such that a cycleat which the encoding unit 103 c (or the pixel plane C1) correspondingto the pixel plane C1 has the highest priority is shorter than the cycleat which the encoding units 103 c (or the pixel planes) corresponding tothe other pixel planes have the highest priority.

Note that because the encoded data amounts allocated to the pixel planesC2 to C4 are the same here, an example is shown in which control isperformed such that the rates of outputting the pixel planes C2 to C4are equalized. However, control may be performed such that the rate ofoutputting the data obtained by encoding at least one of the pixelplanes C2 to C4 differs from the rate of outputting the data obtained byencoding the other pixel planes.

In the present embodiment, the output rates of the encoding units can bedynamically controlled by controlling the output rates of the encodingunits in accordance with the conversion mode in which the componentconversion unit is operating, or in accordance with the encoded dataamounts allocated to the encoding units. Furthermore, the time periodfor which the encoding unit is granted permission to transfer data canbe dynamically controlled in accordance with the operation mode of thecomponent conversion unit, or the encoded data amounts allocated to theencoding units. Therefore, even if the relationship between encoded dataamounts generated in the plurality of encoding units dynamicallychanges, an output rate appropriate for the individual encoding unit canbe realized, and the bandwidth of the data bus that is a shared resourcecan be efficiently utilized. Therefore, it is possible to effectivelyuse the capabilities of the encoding units and improve the throughput ofthe encoding processing.

Second Embodiment

Next, a second embodiment will be described. In the first embodiment,the generated encode amounts of the encoding units 103 c are controlled,and the output rate control unit 103 d knows the relationship of thegenerated encode amounts between the encoding units 103 c. The presentembodiment relates to output rate control in the case where the outputrate control unit 103 d does not know the relationship of the generatedencode amounts between the encoding units 103 c (or in the case wherethe relationship between the generated encode amounts is not used).Hereinafter, differences from the first embodiment will be described.

In the present embodiment, the output rate control unit 103 d updatesthe priorities of the pixel planes (or the encoding units) based on theavailable capacities of the corresponding buffers 103 b, and performsthe control of the rate of outputting encoded data. FIG. 5 is aflowchart showing the output rate control operation (priorityinformation update operation) performed by the output rate control unit103 d in the present embodiment.

First, the output rate control unit 103 d judges the priority of thetransfer request that has been input by the encoding unit 103 c, basedon the priority information (step S500). Here, if there are no transferrequests whose priority needs to be judged, the output rate control unit103 d ends the processing (step S501, NO). On the other hand, if thereis a transfer request whose priority needs to be judged, the output ratecontrol unit 103 d outputs the transfer request that has been judged tohave the highest priority among the transfer requests, to the memory I/Funit 105 (step S501, YES), and advances the processing to step S502.

The output rate control unit 103 d compares the available capacities ofthe buffers 103 b in step S502. As described above, the componentconversion unit 103 a monitors the available capacities of the buffers103 b, and notifies the output rate control unit 103 d of the availablecapacities. The available capacity may be expressed in any format suchas the number of bytes of free space, the ratio of free space to thetotal space, or the like.

It is conceivable that if there is a buffer whose available capacity isless than the other buffers, processing for encoding the pixel planecorresponding to the buffer will be delayed compared to the processingfor encoding the other pixel planes, and the output of the encoded datawill be waited for. Therefore, in step S503, the output rate controlunit 103 d updates the priority information such that the priority ofthe pixel plane corresponding to the buffer having the smallestavailable capacity is the highest. The output rate control in thepresent embodiment is independent of the conversion mode in which thecomponent conversion unit 103 a is operating.

The output rate control unit 103 d repeats the above-describedprocessing. In this manner, the output rate control unit 103 d of thepresent embodiment realizes the control of an appropriate output rate byprioritizing output of the transfer request from the encoding unit 103 ccorresponding to the buffer having a lower available capacity to thememory I/F unit 105.

FIG. 6 is a timing chart schematically showing a specific example of theoutput rate control in the present embodiment in a form similar to FIGS.4A and 4B. Reference signs C1 to C4 indicate pixel planes, and referencesigns p1 to p4 indicate priorities in the priority information. Thesmaller the value is, the higher the priority is, and p1 has the highestpriority. Reference signs T1 to T5 indicate times at which the outputrate control unit 103 d executes the processing of FIG. 3, outputs thetransfer request to the memory I/F unit 105, or updates the priorityinformation. FIGS. 4A and 4B additionally show change over time in theavailable capacities of the buffers 103 b corresponding to the pixelplanes C1 to C4.

The pixel planes and the priorities are associated with each other asfollows in the priority information in an initial state, for example.

(C1, C2, C3, C4)=(p1, p2, p3, p4)

Also, the encoding units 103 c have encoded data that is to betransferred at T1, and outputs the transfer requests.

At T1, based on the priority information, the output rate control unit103 d outputs the transfer request for the pixel plane C1 among thetransfer requests from the encoding units 103 c to the memory I/F unit105. Also, the output rate control unit 103 d compares the availablecapacities of the buffers 103 b, changes the priority of the pixel planeC4 having the smallest available capacity to the highest, and updatesthe priority information by lowering the priorities of the other pixelplanes by one each. The priority information after the update is asfollows. Note that priority may be assigned in order from the smallestavailable capacity.

(C1, C2, C3, C4)=(p2, p3, p4, p1)

When the memory I/F unit 105 grants permission for the transfer requestoutput at T1, the encoded data of the pixel plane C1 is written to thememory 104 from the corresponding encoding unit 103 c, via the outputrate control unit 103 d and the memory I/F unit 105. When the transfergranted time period ends, the writing of the encoded data of the pixelplane C1 ends, and the output of the transfer request from the encodingunit 103 c corresponding to the pixel plane C1 and the output of thetransfer request from the output rate control unit 103 d end.

At T2, the transfer request is again output from the encoding unit 103 ccorresponding to the pixel plane C1, and the output rate control unit103 d receives four transfer requests including the transfer requestsfrom the encoding units 103 c corresponding to the pixel planes C2 to C4that continue to have been received from T1. Based on the priorityinformation, the output rate control unit 103 d outputs the transferrequest for the pixel plane C4 to the memory I/F unit 105 at T2. Also,the output rate control unit 103 d compares the available capacities ofthe buffers 103 b, changes the priority of the pixel plane C2 having thesmallest available capacity to the highest, and updates the priorityinformation by lowering the priorities of the other pixel planes by oneeach. Note that the priority of the pixel plane C3 already having thelowest priority does not change. The priority information after theupdate is as follows.

(C1, C2, C3, C4)=(p3, p1, p4, p2)

Then, similarly to the case of time T1, the encoded data of the pixelplane C4 is written to the memory 104.

At T3, based on the priority information, the output rate control unit103 d outputs the transfer request for the pixel plane C2 to the memoryI/F unit 105. Also, the output rate control unit 103 d compares theavailable capacities of the buffers 103 b, changes the priority of thepixel plane C3 having the smallest available capacity to the highest,and updates the priority information by lowering the priorities of theother pixel planes by one each. The priority information after theupdate is as follows.

(C1, C2, C3, C4)=(p4, p2, p1, p3)

Then, similarly to the case of time T1, the encoded data of the pixelplane C2 is written to the memory 104.

Similarly, at T4, based on the priority information, the output ratecontrol unit 103 d outputs the transfer request for the pixel plane C3to the memory I/F unit 105. Also, the output rate control unit 103 dchanges the priority of the pixel plane C1 having the smallest availablecapacity of the buffer to the highest, and updates the priorityinformation by lowering the priorities of the other pixel planes by oneeach. The priority information after the update is as follows.

(C1, C2, C3, C4)=(p1, p3, p2, p4)

Then, similarly to the case of time T1, the encoded data of the pixelplane C3 is written to the memory 104.

Similarly, at T5 as well, based on the priority information, the outputrate control unit 103 d outputs the transfer request for the pixel planeC1 to the memory I/F unit 105. Also, the output rate control unit 103 dchanges the priority of the pixel plane C4 having the smallest availablecapacity of the buffer to the highest, and updates the priorityinformation by lowering the priorities of the other pixel planes by oneeach. The priority information after the update is as follows.

(C1, C2, C3, C4)=(p2, p4, p3, p1)

Then, similarly to the case of time T1, the encoded data of the pixelplane C1 is written to the memory 104.

Thereafter, similar processing is repeated.

In this manner, according to the present embodiment, the output rates ofthe encoding units are controlled in accordance with the availablecapacities or free space of the buffers that are to store the pixelplanes, and thus the output rates of the encoding units can bedynamically controlled. Furthermore, it is possible to periodicallycompare the available capacities or the free space of the buffers thatare to store the pixel planes, and increase the transfer requestpriority of the encoding unit corresponding to the buffer having asmaller available capacity or less free space compared to the transferrequest priorities of the other encoding units. Accordingly, the timeperiod for which data transfer is granted for the encoding unit that hasa large generated encode amount or will need to be waited for totransfer encoded data is set longer than in the other encoding units,and appropriate output rate control can be realized. Therefore, even ifthe relationship between encoded data amounts generated in the pluralityof encoding units changes, an output rate appropriate for the individualencoding unit can be realized, and the bandwidth of the data bus that isa shared resource can be efficiently utilized. Therefore, it is possibleto effectively use the capabilities of the encoding units and improvethe throughput of the encoding processing.

Third Embodiment

Next, a third embodiment will be described. The third embodiment is acombination of the output rate control of the first embodiment and theoutput rate control of the second embodiment. After updating priorityinformation in accordance with the conversion mode in which thecomponent conversion unit 103 a is operating, an output rate controlunit 103 d of the present embodiment further changes the priorityinformation in accordance with the available capacities or free space ofthe buffers.

The operations of the output rate control unit 103 d of the presentembodiment will be described using a flowchart shown in FIG. 7. Notethat in FIG. 7, the same reference numerals are given in processingsteps similar to those in FIGS. 3 and 5, and the description thereof isomitted.

As shown in FIG. 7, similarly to the first embodiment, first, the outputrate control unit 103 d judges the priority, outputs a transfer request,and performs processing for updating the priorities (steps S301 toS307). Subsequently, the output rate control unit 103 d compares theavailable capacities of the buffers that have been received from thecomponent conversion unit 103 a (step S502). Then, the output ratecontrol unit 103 d changes the priority of the pixel plane having thesmallest available capacity (or the corresponding encoding unit) to thehighest, and updates the priority information by lowering the prioritiesof the other pixel planes by one each (step S503).

In the present embodiment, output rate control in accordance with theconversion mode in which the component conversion unit is operating orencoded data amounts allocated to the encoding units is combined withoutput rate control in accordance with the available capacities or freespace of the buffers. Thus, in addition to the effect of the firstembodiment, the effect of allowing appropriate output rate control canbe realized even in the case where variation in the generated encodeamounts of the encoding units occurs.

Other Embodiments

Embodiments of the present invention can also be realized by a computerof a system or apparatus that reads out and executes computer executableinstructions (e.g., one or more programs) recorded on a storage medium(which may also be referred to more fully as a ‘non-transitorycomputer-readable storage medium’) to perform the functions of one ormore of the above-described embodiments and/or that includes one or morecircuits (e.g., application specific integrated circuit (ASIC)) forperforming the functions of one or more of the above-describedembodiments, and by a method performed by the computer of the system orapparatus by, for example, reading out and executing the computerexecutable instructions from the storage medium to perform the functionsof one or more of the above-described embodiments and/or controlling theone or more circuits to perform the functions of one or more of theabove-described embodiments. The computer may comprise one or moreprocessors (e.g., central processing unit (CPU), micro processing unit(MPU)) and may include a network of separate computers or separateprocessors to read out and execute the computer executable instructions.The computer executable instructions may be provided to the computer,for example, from a network or the storage medium. The storage mediummay include, for example, one or more of a hard disk, a random-accessmemory (RAM), a read only memory (ROM), a storage of distributedcomputing systems, an optical disk (such as a compact disc (CD), digitalversatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, amemory card, and the like.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all such modifications and equivalent structures andfunctions.

This application claims the benefit of Japanese Patent Application No.2015-214806, filed on Oct. 30, 2015, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. An image processing apparatus comprising: aconversion unit configured to convert image data to a plurality of pixelplanes; a plurality of first storage units configured to respectivelystore one of the plurality of pixel planes; a plurality of encodingunits configured to respectively encode a pixel plane stored in acorresponding one of the plurality of first storage units; a ratecontrol unit configured to control output rates from the plurality ofencoding units to a second storage unit; and an access control unitconfigured to grant an access request for access to the second storageunit, wherein the rate control unit controls the output rates bycontrolling an access request that is to be output to the access controlunit among access requests to the second storage unit from the pluralityof encoding units, in accordance with a conversion mode of theconversion unit and/or available capacities of the first storage units.2. The image processing apparatus according to claim 1, wherein the ratecontrol unit controls the output rates such that in a case where theconversion mode is a second conversion mode, the output rate of anencoding unit among the plurality of encoding units that encodes aparticular pixel plane is larger than in a case where the conversionmode is a first conversion mode.
 3. The image processing apparatusaccording to claim 2, wherein the conversion unit converts the imagedata to a red pixel plane, a green pixel plane, and a blue pixel planein the first conversion mode, and converts the image data to a luminancecomponent pixel plane and a color difference component pixel plane inthe second conversion mode.
 4. The image processing apparatus accordingto claim 3, wherein the particular pixel plane is the luminancecomponent pixel plane.
 5. The image processing apparatus according toclaim 1, wherein the rate control unit prioritizes output of the accessrequest to the access control unit from the encoding unit correspondingto a first storage unit having a smallest available capacity among theplurality of first storage units.
 6. The image processing apparatusaccording to claim 1, wherein the rate control unit periodicallyoutputs, to the access control unit, one of the access requests to thesecond storage unit from the plurality of encoding units.
 7. The imageprocessing apparatus according to claim 1, wherein the image data is RAWdata having a primary color Bayer pattern.
 8. An image capture apparatuscomprising: an image sensor; a conversion unit configured to convertimage data obtained by the image sensor to a plurality of pixel planes;a plurality of first storage units configured to respectively store oneof the plurality of pixel planes; a plurality of encoding unitsconfigured to respectively encode a pixel plane stored in acorresponding one of the plurality of first storage units; a ratecontrol unit configured to control output rates from the plurality ofencoding units to a second storage unit; and an access control unitconfigured to grant an access request for access to the second storageunit, wherein the rate control unit controls the output rates bycontrolling an access request that is to be output to the access controlunit among access requests to the second storage unit from the pluralityof encoding units, in accordance with a conversion mode of theconversion unit and/or available capacities of the first storage units.9. An image processing method executed by an image processing apparatusthat comprises: a conversion unit configured to convert image data to aplurality of pixel planes; a plurality of first storage units configuredto respectively store one of the plurality of pixel planes; a pluralityof encoding units configured to respectively encode a pixel plane storedin a corresponding one of the plurality of first storage units; a secondstorage unit shared by the plurality of encoding units; and an accesscontrol unit configured to grant an access request for access to thesecond storage unit, the method comprising: controlling the output ratesfrom the plurality of encoding units to the second storage unit, bycontrolling an access request that is to be output to the access controlunit among access requests to the second storage unit from the pluralityof encoding units, in accordance with a conversion mode of theconversion unit and/or available capacities of the first storage units.10. A non-transitory computer-readable storage medium storing a programfor causing a computer to function as an image processing apparatuscomprising: a conversion unit configured to convert image data to aplurality of pixel planes; a plurality of first storage units configuredto respectively store one of the plurality of pixel planes; a pluralityof encoding units configured to respectively encode a pixel plane storedin a corresponding one of the plurality of first storage units; a ratecontrol unit configured to control output rates from the plurality ofencoding units to a second storage unit; and an access control unitconfigured to grant an access request for access to the second storageunit, wherein the rate control unit controls the output rates bycontrolling an access request that is to be output to the access controlunit among access requests to the second storage unit from the pluralityof encoding units, in accordance with a conversion mode of theconversion unit and/or available capacities of the first storage units.